import request from '@/utils/request'

export function showBannerList(query) {
  return request({
    url: '/banner/show',
    method: 'get',
    params: query
  })
}

export function saveBanner(data) {
  return request({
    url: '/banner/save',
    method: 'post',
    data
  })
}

export function deleteBanner(bannerId) {
  return request({
    url: '/banner/remove',
    method: 'get',
    params: { 'bannerId': bannerId }
  })
}

export function updateRank(data) {
  return request({
    url: '/banner/rank',
    method: 'post',
    data
  })
}

export function getBanner(bannerId) {
  return request({
    url: '/banner/get',
    method: 'get',
    params: { 'bannerId': bannerId }
  })
}

export function getProduct(productNo) {
  return request({
    url: '/banner/product/get',
    method: 'get',
    params: { 'productNo': productNo }
  })
}

export function searchProduct(query) {
  return request({
    url: '/banner/product/search',
    method: 'get',
    params: { 'query': query }
  })
}

export function getNews(newsId) {
  return request({
    url: '/banner/news/get',
    method: 'get',
    params: { 'newsId': newsId }
  })
}

export function searchNews(query) {
  return request({
    url: '/banner/news/search',
    method: 'get',
    params: { 'query': query }
  })
}
